﻿<%@ Page Language="C#" MasterPageFile="~/Demo/DemoMaster.master" %>

<script runat="server">

</script>
<asp:Content ID="Content1" ContentPlaceHolderID="demoheader" runat="Server">
    Format data
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="demosubheader" runat="Server">
    Use <span>$d</span> to parse/format date time and string values
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="democontent" runat="Server">
    <style type="text/css">
        #demo
        {
            margin-left: 20px;
            margin-bottom: 60px;
        }
        #demo h4
        {
            font-size: 15px;
            margin-bottom: 0px;
            text-decoration: underline;
        }
        
        #demo h4 span.header
        {
            color: #54A6DE;
        }
        #demo ul li span
        {
            color: #54A6DE;
            font-weight: bold;
        }
        #demo li
        {
            margin-bottom: 10px;
        }
    </style>
    <div id="demo">
        <div>
            <h4>
                <span class="header">Original date time string: </span>/Date(349956184000)/
            </h4>
            <ul>
                <li><span>Format to "MMMM d yyyy h:m tt":</span>
                    <div id="date">
                    </div>
                </li>
                <li><span>Add 90 days:</span>
                    <div id="plusdate">
                    </div>
                </li>
            </ul>
        </div>
        <div>
            <h4>
                <span class="header">Original string: </span><span style="color: red">Red text</span></h4>
            <ul>
                <li><span>Encode HTML:</span>
                    <div id="encode">
                    </div>
                </li>
                <li><span>Strip HTML:</span>
                    <div id="strip">
                    </div>
                </li>
                <li><span>Truncate: </span>
                    <div id="trun">
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <script type="text/javascript" src="../jQueryClient/dataformat.js"></script>
    <script type="text/javascript" src="../jQueryClient/datejs.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#date").html($d.datetime.format("/Date(349956184000)/", "MMMM d yyyy h:m tt"));
            $("#plusdate").html($d.datetime.parse("/Date(349956184000)/").addDays(90).toString("MM/dd/yyyy"));

            $("#encode").html($d.string.encodeHTML("<span style='color:red'>Red text</span>"));
            $("#strip").html($d.string.stripHTML("<span style='color:red'>Red text</span>"));
            $("#trun").html($d.string.truncate("Red text", 3));
        });
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="javascript" runat="Server">
    <pre name="javascriptcode" class="js:nocontrols">
			$("#date").html($d.datetime.format("/Date(349956184000)/", "MMMM d yyyy h:m tt"));
			$("#plusdate").html($d.datetime.parse("/Date(349956184000)/").addDays(90).toString("MM/dd/yyyy"));

			$("#encode").html($d.string.encodeHTML('<span style="color: red">Red text</span>'));
			$("#strip").html($d.string.stripHTML('<span style="color: red">Red text</span>'));
			$("#trun").html($d.string.truncate("Red text", 3));
	</pre>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="html" runat="Server">
    <pre name="htmlcode" class="html:nocontrols"> 
		&lt;div&gt;
			&lt;h4&gt;
				&lt;span class=&quot;header&quot;&gt;Original date time string: &lt;/span&gt;/Date(349956184000)/
			&lt;/h4&gt;
			&lt;ul&gt;
				&lt;li&gt;
					&lt;span&gt;Format to &quot;MMMM d yyyy h:m tt&quot;:&lt;/span&gt;
					&lt;div id=&quot;date&quot;&gt;&lt;/div&gt;
				&lt;/li&gt;
				&lt;li&gt;
					&lt;span&gt;Add 90 days:&lt;/span&gt;
					&lt;div id=&quot;plusdate&quot;&gt;&lt;/div&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/div&gt;
		&lt;div&gt;
			&lt;h4&gt;
				&lt;span class=&quot;header&quot;&gt;Original string: &lt;/span&gt;
				&lt;span style=&quot;color:red&quot;&gt;Red text&lt;/span&gt;
			&lt;/h4&gt;
			&lt;ul&gt;
				&lt;li&gt;
					&lt;span&gt;Encode HTML:&lt;/span&gt;
					&lt;div id=&quot;encode&quot;&gt;&lt;/div&gt;
				&lt;/li&gt;
				&lt;li&gt;
					&lt;span&gt;Strip HTML:&lt;/span&gt;
					&lt;div id=&quot;strip&quot;&gt;&lt;/div&gt;
				&lt;/li&gt;
				&lt;li&gt;
					&lt;span&gt;Truncate: &lt;/span&gt;
					&lt;div id=&quot;trun&quot;&gt;&lt;/div&gt;
				&lt;/li&gt;
			&lt;/ul&gt;
		&lt;/div&gt;
	</pre>
</asp:Content>
